From 348871d9fc4628713501c6198ed7738703db7f4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Thu, 13 Jul 2017 16:28:49 +0200 Subject: [PATCH] Fix a few testsuite failures Adjust default property values, skip GtkRange:adjustment. --- gtk/gtkentry.c | 2 +- gtk/gtkeventbox.c | 2 +- gtk/gtkspinbutton.c | 6 +++--- testsuite/gtk/defaultvalue.c | 12 ++++++++++++ testsuite/gtk/gtkmenu.c | 4 ++++ 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 478092011a..5c3a9f1915 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -7864,7 +7864,7 @@ gtk_entry_get_icon_sensitive (GtkEntry *entry, icon_info = priv->icons[icon_pos]; if (!icon_info) - return FALSE; + return TRUE; /* Default of the property */ return gtk_widget_get_sensitive (icon_info->widget); } diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c index ae1b5332c4..6a6ba9f2eb 100644 --- a/gtk/gtkeventbox.c +++ b/gtk/gtkeventbox.c @@ -95,7 +95,7 @@ gtk_event_box_class_init (GtkEventBoxClass *class) g_param_spec_boolean ("visible-window", P_("Visible Window"), P_("Whether the event box is visible, as opposed to invisible and only used to trap events."), - TRUE, + FALSE, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_install_property (gobject_class, PROP_ABOVE_CHILD, diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 2593cd8bd1..71498d9071 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -422,7 +422,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) g_param_spec_string ("text", P_("Text"), P_("The contents of the entry"), - "", + "0", /* Default value of the default adjustment */ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); g_object_class_override_property (gobject_class, @@ -436,8 +436,8 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) * * The ::input signal can be used to influence the conversion of * the users input into a double value. The signal handler is - * expected to use gtk_entry_get_text() to retrieve the text of - * the entry and set @new_value to the new value. + * expected to use gtk_spin_button_get_text() to retrieve the text of + * the spinbutton and set @new_value to the new value. * * The default conversion uses g_strtod(). * diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c index e54b499d70..698471e199 100644 --- a/testsuite/gtk/defaultvalue.c +++ b/testsuite/gtk/defaultvalue.c @@ -331,6 +331,18 @@ G_GNUC_END_IGNORE_DEPRECATIONS strcmp (pspec->name, "show-desktop") == 0) continue; + /* GtkRange constructs an adjustment on its own if NULL is set and + * the property is a CONSTRUCT one, so the returned value is never NULL. */ + if (g_type_is_a (type, GTK_TYPE_RANGE) && + strcmp (pspec->name, "adjustment") == 0) + continue; + + /* ... and GtkScrollbar wraps that property. */ + if (g_type_is_a (type, GTK_TYPE_SCROLLBAR) && + strcmp (pspec->name, "adjustment") == 0) + continue; + + if (g_test_verbose ()) g_print ("Property %s.%s\n", g_type_name (pspec->owner_type), diff --git a/testsuite/gtk/gtkmenu.c b/testsuite/gtk/gtkmenu.c index c17d50aa75..589576c6d8 100644 --- a/testsuite/gtk/gtkmenu.c +++ b/testsuite/gtk/gtkmenu.c @@ -228,6 +228,8 @@ get_label (GtkMenuItem *item) children = g_list_concat (children, gtk_container_get_children (children->data)); else if (GTK_IS_LABEL (children->data)) label = gtk_label_get_text (children->data); + else if (GTK_IS_ACCEL_LABEL (children->data)) + label = gtk_accel_label_get_label (children->data); children = g_list_delete_link (children, children); } @@ -372,6 +374,8 @@ assert_section_equality (GSList **children, contents = gtk_bin_get_child ((*children)->data); if (GTK_IS_LABEL (contents)) label = gtk_label_get_label (GTK_LABEL (contents)); + else if (GTK_IS_ACCEL_LABEL (contents)) + label = gtk_accel_label_get_label (GTK_ACCEL_LABEL (contents)); else label = ""; -- 2.30.2